﻿@model FTBS.Models.Entities.Room
@{
    ViewBag.Title = "Tạo phòng";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
    var messageIsExistTheater = TempData["IsExistTheater"] ?? string.Empty;
}

<legend style="margin-top: 10px">Tạo Phòng</legend>

@using (Html.BeginForm("Create", "Room", null, FormMethod.Post,
                              new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
      
    <table class="table striped bordered hovered" style="margin: 0px 0px 0px 0px">
        <tr>
            <td style="padding: 0px 10px 0px 20px">
                <div id="txtFilmName" style="font-weight: bold">
                    @Html.LabelFor(model => model.RoomName, "Tên phòng")
                </div>
                <div class="input-control text">
                    @Html.EditorFor(model =>model.RoomName)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.RoomName)</p>
                    @if (messageIsExistTheater != string.Empty)
                    {
                       <p style="color: red; font-size: 10pt">Tên phòng đã được tạo!</p>
                    }
                </div>
            </td>
               <td style="padding: 0px 10px 0px 20px">
                <div style="font-weight: bold">
                    @Html.LabelFor(model => model.TheaterId, "Rạp")
                </div>
                <div id="categoryCombobox">
                    <div class="input-control select">
                        <div>
                            @Html.DropDownListFor(model => model.TheaterId, (SelectList)ViewBag.TheaterId, "---Chọn Rạp---")
                            <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.TheaterId)</p>
                        </div>
                    </div>
                </div>
            </td>
        </tr>
     
        <tr>
            <td colspan="2" style="vertical-align:central">
                <input class="info" type="submit" value="Tạo Phòng" />
                  <button class="button danger" style="display:inline-block">
                @Html.ActionLink("Quay lại", "Index")
                      </button>
            </td>
        </tr>

    </table>
    
}

<div id="categoryPartial" style="display: none">
    @Html.Partial("~/Views/Film/CategoryPartial.cshtml", new FTBS.Models.Entities.Category())
</div>

<div id="formatPartial" style="display: none">
    @Html.Partial("~/Views/Film/FormatPartial.cshtml", new FTBS.Models.Entities.Format())
</div>